#pragma once

#pragma unmanaged

#include <BWSAL\Basemanager.h>

#pragma managed

#include "..\AiBase.h"
#include "Interfaces\IBaseManager.h"
#include "Interfaces\IBorderManager.h"

namespace BroodWar
{
	namespace Addon
	{
		public ref class BaseManager : public AiBase, IBaseManager
		{
		internal:
			BWSAL::BaseManager* instance;

			BaseManager(BWSAL::BaseManager* manager);
			~BaseManager();
			!BaseManager();

			static BaseManager^ s_instance;
		public:
			static void Create(IBorderManager^ borderManager);
			static property BaseManager^ Instance { BaseManager^ get(); }

			virtual void OnFrame() override;
			virtual void OnUnitDestroy(Unit^ unit) override;
			virtual Base^ GetBase(BaseLocation^ location);

			virtual Base^ ExpandNow();
			virtual Base^ ExpandNow(BaseLocation^ location);
			virtual Base^ ExpandNow(BaseLocation^ location, bool getGas);
			virtual Base^ ExpandWhenPossible();
			virtual Base^ ExpandWhenPossible(BaseLocation^ location);
			virtual Base^ ExpandWhenPossible(BaseLocation^ location, bool getGas);
			virtual Base^ ExpandAtFrame(int frame);
			virtual Base^ ExpandAtFrame(int frame, BaseLocation^ location);
			virtual Base^ ExpandAtFrame(int frame, BaseLocation^ location, bool getGas);

			virtual property HashSet<Base^>^ ActiveBases { HashSet<Base^>^ get(); }
			virtual property HashSet<Base^>^ ReadyBases { HashSet<Base^>^ get(); }
			virtual property HashSet<Base^>^ AllBases { HashSet<Base^>^ get(); }
			virtual property HashSet<Base^>^ DestroyedBases { HashSet<Base^>^ get(); }

			virtual property String^ Name { String^ get(); }
			virtual String^ ToString() override;
		};
	}
}
